-- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- --------------------------------------------------------------------------------
DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `GetAllRelationsUser`(IN p_userId BIGINT)
BEGIN

SELECT `relations`.`relationId`, `users`.`userId`,`users`.`fullName` 
FROM `users`,`relations` 
WHERE `relations`.`userId` = p_userId AND `relations`.`relationuserId` = `users`.`userId`;

END
